﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    var keyValue = $.request("keyValue");
    $(function () {

        $("#F_OrderId").val(keyValue);

        $.ajax({
            url: "/OrderFlowManage/ClientOrder/GetTakelookGridByIntentionSiteJson",
            data: { orderId: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                var html = '';
                if (data && data.rows) {
                    for (var i in data.rows) {
                        var item = data.rows[i];
                        html += '<option value="' + item.F_SiteId + '|' + item.F_SpaceId +'">';
                        html += item.SiteName;
                        html += '</option>';
                    }
                }
                $("#F_SiteId").html(html).bindSelect();
            }
        });

        $("#F_ServiceCode").bindSelect({
            url: "/OrderFlowManage/ClientOrder/GetItemJson?enCode=ServicesCost",
            //search: true,
            id: "Value",
            text: "Text"
        });

    });
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/OrderFlowManage/ClientOrder/SubmitIntentionServiceForm?keyValue=" + keyValue,
            param: $.extend($("#form1").formSerialize(), { F_ServiceName: $("#F_ServiceCode option:selected").text() }),
            success: function () {
                $.currentWindow().vm.intentionsite.initIntentionService();
                $.loading(false);
            }
        });
    }
</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">
            <tr>
                <th class="formTitle">意向场地</th>
                <td class="formValue">
                    <input type="hidden" id="F_OrderId" name="F_OrderId" value="" />
                    <select id="F_SiteId" name="F_SiteId" type="text" class="form-control required"></select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">配套服务</th>
                <td class="formValue">
                    <select id="F_ServiceCode" name="F_ServiceCode" type="text" class="form-control"></select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">价格(元)</th>
                <td class="formValue">
                    <input id="F_Price" name="F_Price" type="text" class="form-control required number" placeholder="请录入价格" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">价格单位</th>
                <td class="formValue">
                    <input id="F_PriceUnit" name="F_PriceUnit" type="text" class="form-control required" placeholder="价格单位" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">服务描述</th>
                <td class="formValue">
                    <textarea id="F_Remark" name="F_Remark" rows="4" class="form-control"></textarea>
                </td>
            </tr>
        </table>
    </div>
</form>


